<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="lib :: common_header"></head>
<body>
<style>
            .el-table__expanded-cell[class*=cell] { padding: 0px 0px; } </style>
<div th:replace="lib :: header_box"></div>
<div th:replace="lib :: menu_box (422)"></div>

<div class="main-box">
    <div class="main-container">
        <!-- 面包屑导航 -->
        <div class="row main-container-header">
            <div class="col-md-12 rel">
                <div class="main-container-header-line fix">
                    <div class="row">
                        <div class="col-xs-6 col-md-6"> <h4 class="g4">
                            平台资产
                        </h4></div>
                        <div class="col-xs-6 col-md-6 tr f12">
                            <div class="bread-link-box">
                                当前位置：数据资产审批
                                &nbsp;&gt;&nbsp;
                                平台资产
                            </div><!-- /bread-link-box -->
                        </div>
                    </div><!-- /row -->
                </div><!-- main-container-header-line -->
            </div>
        </div><!-- /main-container-header -->

        <div class="f14" id="app" v-cloak>
            <br>
            <template>
                <el-tabs type="border-card" v-model="activeName" @tab-click="tabClick">
                    <el-tab-pane label="未审批" name="first">
                        <template>
                            <el-table :data="projects"
                                      :show-header="false"
                                      :default-expand-all="true"
                                      style="width: 100%">
                                <el-table-column type="expand">
                                    <template slot-scope="scope">
                                        <div class="rel" style="padding:10px 20px;">
                                            <table width="100%">
                                                <tr v-for="(item, index) in scope.row.associators">
                                                    <td style="padding-left:50px; border:0;">
                                                        <div class="rel">
                                                            <div class="pt5 pb5 rel">
                                                                <i :id="'nima_' + scope.row.project.id + '_' + index" class="dn glyphicon glyphicon-send pushOut abs" style="font-size:70px; color:#67C23A;"></i>
                                                                <span style="color:#ababab;">所属组织：{{ item.name }}</span>
                                                            </div>
                                                            <ul class="f12 b" style="margin:0;" v-for="asset in item.assets">
                                                                <li class="pt5 pb5"><i class="el-icon-coin"></i> {{ asset.name }} &nbsp; [{{ asset.file_name }}]</li>
                                                            </ul>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column>
                                    <template scope="scope">
                                        申请项目：<span class="red b">{{ scope.row.project.name }}</span>
                                        <el-divider direction="vertical"></el-divider>
                                        <span class="ell">申请人：{{ scope.row.applicant.name }}</span>
                                        <el-divider direction="vertical"></el-divider>
                                        <span>申请时间：{{ scope.row.applicant.created }}</span>
                                    </template>
                                </el-table-column>
                                <el-table-column width="120">
                                    <template scope="scope">
                                        <el-button @click="openApply(scope.row)">
                                            平台审批
                                        </el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </template>
                    </el-tab-pane>

                    <el-tab-pane label="已审批" name="second">
                        <table class="m_srchList" width="100%">
                            <tr v-for="item in projects2">
                                <td>
                                    <p>
                                        <span class="b">{{ item.name }}</span>
                                        <span> [ {{ item.file_name }} ]</span>
                                    </p>
                                    <p>
                                        <span class="f12">申请项目：<span class="red">{{ item.project.name }}</span> </span>
                                        <el-divider direction="vertical"></el-divider>
                                        <span class="f12">审批结果：</span>
                                        <el-tag type="success"
                                                effect="dark"
                                                size="mini">
                                            {{ item.cv_approval_result | cvApprovalResult }}
                                        </el-tag>
                                    </p>
                                    <p>
                                        <span class="f12">申请人：{{ item.applicant.name }}</span>
                                        <el-divider direction="vertical"></el-divider>
                                        <span class="f12">审批时间：{{ item.associator_approval_date }}</span>
                                    </p>
                                </td>
                                <td width="100">
                                    <el-popover
                                            placement="left"
                                            title="查看审批明细"
                                            width="300"
                                            trigger="click">
                                        <table width="100%">
                                            <tr>
                                                <td valign="top" width="100">平台审批意见：</td>
                                                <td>同意！！</td>
                                            </tr>
                                        </table>
                                        <el-button type="mini" slot="reference">查看审批意见</el-button>
                                    </el-popover>
                                </td>
                            </tr>
                        </table>
                    </el-tab-pane>
                </el-tabs>
            </template>

            <el-dialog
                    title="平台管理员审批"
                    :visible.sync="dialogVisible"
                    width="400px">
                <div>
                    <el-form ref="form" label-width="120px">
                        <el-form-item label="项目名称：">
                            {{ applyForm.projectName }}
                        </el-form-item>
                        <el-form-item label="数据名称：">
                            <ul style="margin-bottom:0;" v-for="item in applyForm.associators">
                                <li v-for="item2 in item.assets">
                                    {{ item2.name }}
                                </li>
                            </ul>
                        </el-form-item>
                        <el-form-item label="申请人：">
                            {{ applyForm.userName }}
                        </el-form-item>
                        <el-form-item label="审批结果：">
                            <el-radio v-model="radio" label="P">同意</el-radio>
                            <el-radio v-model="radio" label="R">不同意</el-radio>
                        </el-form-item>
                    </el-form>
                </div>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="dialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="agree">确 定</el-button>
                </span>
            </el-dialog>

            <el-dialog
                    title="审批明细"
                    :visible.sync="dialogVisible2"
                    width="400px">
                <div>
                    <el-form ref="form" label-width="120px">
                        <el-form-item label="项目名称：">
                            东软-盛京合作项目
                        </el-form-item>
                        <el-form-item label="数据名称：">
                            静态12导联心电数据集
                        </el-form-item>
                        <el-form-item label="申请人：">
                            王希（平台管理员）
                        </el-form-item>
                        <el-form-item label="审批结果：">
                            同意 （2019年6月6日）
                        </el-form-item>
                    </el-form>
                </div>
                <span slot="footer" class="dialog-footer">
                            <el-button @click="dialogVisible3 = false">关 闭</el-button>
                        </span>
            </el-dialog>

        </div><!-- /app -->
    </div>
</div>
<div th:replace="lib :: javascript_box"></div>
<script th:src="@{/lib/console/asset_approval2.js}"></script>
</body>
</html>
